<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <link href="layui/css/layui.css" rel="stylesheet">
  <script src="layui/layui.js"></script>
</head>
<body>

<form id="myform" lay-filter="updateform"
      class="layui-form layui-form-pane"
      style="margin: 30px auto; display: inline-block;" >
  <div class="layui-form-item" style="text-align: center;">
    <label class="layui-form-label layui-bg-gray" style="width: 140px; margin-left: 35px">子版块Id</label>
    <div class="layui-input-inline">
      <input type="text" lay-verify="required"
             autocomplete="off" placeholder="子版块Id" class="layui-input" name="plateId" id="plateId">
    </div>
  </div>
  <div class="layui-form-item" style="text-align: center;">
    <label class="layui-form-label layui-bg-gray" style=" width: 140px;margin-left: 50px;">板块名称</label>
    <div class="layui-input-inline">
      <input type="text" lay-verify="required" name="plateName" id="plateName"
             autocomplete="off" placeholder="板块名称 " class="layui-input"
             onkeyup="value=value.replace(/[\d]/g,'') "
             onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[\d]/g,''))">
    </div>
  </div>
  <div class="layui-form-item" style="text-align: center;">
    <label class="layui-form-label layui-bg-gray" style="width: 140px; margin-left: 35px">父板块ID</label>
    <div class="layui-input-inline">
      <input type="text" lay-verify="required"
             autocomplete="off" placeholder="父板块ID" class="layui-input" name="plateFatherId" id="plateFatherId">
    </div>
  </div>
  <div class="layui-form-item" style="text-align: center;">
    <label class="layui-form-label layui-bg-gray" style="width: 140px; margin-left: 35px">备注</label>
    <div class="layui-input-inline">
      <input type="text" lay-verify="required"
             autocomplete="off" placeholder="备注" class="layui-input" name="plateRemark" id="plateRemark">
    </div>
  </div>
  <div class="layui-form-item" style="position: absolute;left: 28%; bottom: 20px">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="updatePlate"><i class="layui-icon">&#x1005;</i>添加</button>
      <button type="reset" class="layui-btn layui-btn-primary"> <i class="layui-icon">&#x1006;</i>取消</button>
    </div>
  </div>
</form>

<script type="text/javascript">
  layui.use('form',function (){
    var form = layui.form;
    var $ = layui.jquery;

    form.on('submit(update)',function (obj) {
      // console.log("1"+obj.field);
      var data = form.val("updateform");

      $.post("toUpdatePlate",data,function (msg) {
        alert("ok")
        console.log(msg)
      })
      return false;
    });
  })
</script>
</body>
</html>